using System.Windows.Forms;
using System.Diagnostics;

namespace TeamReview.UI
{
    public partial class DirectionsForm : Form
    {
        private string _reason;

        private const string STANDARD_DIRECTIONS = @"TeamReview is the most complete solution for Team System Code Reviews: a specific work item type and a Visual Studio add-in for a completely in IDE code review experience.

To use TeamReview Visual Studio must be online, a Visual Studio Solution must be open and within a Team System workspace mapping. Additionally Team Projects that that will store work items must have the Code Review Response work item type.

To setup a Team System project for TeamReview usage please use the following directions from the TeamReview codeplex site. 



Thank You,
TeamReview contributors";

        private const string REASON_DIRECTSIONS = @"{0}




To setup a Team System project for TeamReview usage please use the following directions from the TeamReview codeplex site.";

        public DirectionsForm()
            : this(string.Empty)
        {

            InitializeComponent();
        }

        public DirectionsForm(string reason)
        {
            _reason = reason;
            InitializeComponent();
        }
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ProcessStartInfo sInfo = new ProcessStartInfo(e.Link.LinkData.ToString());
            Process.Start(sInfo);
        }

        private void DirectionsForm_Load(object sender, System.EventArgs e)
        {
            if (!string.IsNullOrEmpty(_reason))
            {
                this.richTextBox1.Text = string.Format(REASON_DIRECTSIONS, _reason);
                this.richTextBox1.ForeColor = System.Drawing.Color.Red;
            }
            else
            {
                this.richTextBox1.Text = STANDARD_DIRECTIONS;
                this.richTextBox1.ForeColor = System.Drawing.Color.Black;
            }

            linkLabel1.Links.Clear();
            linkLabel1.Links.Add(0, linkLabel1.Text.Length, "http://TeamReview.codeplex.com");
        }


    }
}